package com.tencent.cloud.uikit.widget.edittext;

import android.content.Context;
import android.text.InputType;
import android.util.AttributeSet;

import com.tencent.cloud.iov.util.PatternMatchingUtils;
import com.tencent.cloud.iov.util.ResourcesUtils;
import com.tencent.cloud.uikit.R;

/**
 * @author vinsonhuang
 * @date 2018/6/26
 */
public class TelephoneEditText extends LineEditText {

    public static final int TELEPHONE_LENGTH = 11;

    /**
     * @param context
     * @param attrs
     */
    public TelephoneEditText(Context context, AttributeSet attrs) {
        super(context, attrs);
        setInputType(InputType.TYPE_CLASS_PHONE);
        setTextColor(ResourcesUtils.getColor(R.color.text_color_primary));
        setInputLength(TELEPHONE_LENGTH);
        setTextFormat(PatternMatchingUtils.TELEPHONE_FORMAT);
    }
}
